package structure.privilege.test;

import structure.privilege.basic.MyPriorityQueue;
import structure.privilege.basic.Person;

import java.util.PriorityQueue;

/**
 * 项目名称: god
 * 包 名 称: structure.privilege.test
 * 类 名 称: Main
 * 类 描 述: TODO
 * 创建时间: 2020/6/19 8:14 下午
 * 创 建 人: Justice
 */
public class Main {
    public static void main(String[] args) {
        test1();
    }

    private static void test() {
        MyPriorityQueue<Person> queue = new MyPriorityQueue<>();
        queue.enQueue(new Person("Jack", 10));
        queue.enQueue(new Person("Tom", 30));
        queue.enQueue(new Person("Jim", 40));
        queue.enQueue(new Person("Tim", 5));
        queue.enQueue(new Person("Nancy", 20));
        queue.enQueue(new Person("Nike", 90));
        queue.enQueue(new Person("Mike", 60));
        while (!queue.isEmpty()) {
            System.out.println(queue.deQueue());
        }
    }

    private static void test1(){
        PriorityQueue<Person> queue = new PriorityQueue<>();
        queue.add(new Person("Jack", 10));
        queue.add(new Person("Ann", 100));
        queue.add(new Person("Bob", 4));
        queue.add(new Person("Lucy", 7));
        while (!queue.isEmpty()){
            System.out.println(queue.poll());
        }
    }
}
